package com.demo2do.fms.admin.dao.business;

import java.util.HashMap;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.demo2do.core.persistence.GenericJdbcSupport;

/**
 *
 * @author Ark
 *
 */
@Repository("otherStatusDaoSupport")
public class OtherStatusDaoSupport {

    @Autowired
    private GenericJdbcSupport genericJdbcSupport;
    
    /**
     * get order status
     * 
     * @param financeId
     * @param shipmentFinanceId
     * @return
     */
    public int getOrderStatus(Long financeId, Long shipmentFinanceId) {
        
        // 1. construct sentence
        String sentence = "SELECT FC_GET_ORDER_STATUS(:financeId, :shipmentFinanceId) FROM DUAL";
        
        // 2. build sentence
        Map<String, Object> parameters = new HashMap<String, Object>();
        parameters.put("financeId", financeId);
        parameters.put("shipmentFinanceId", shipmentFinanceId);
        
        return genericJdbcSupport.queryForInt(sentence, parameters);
        
    }
    
}
